#!/bin/bash

# 删除右边的换行符
function trim_right() {
    local s=$1
    while [ "\n" == "${s[${#s} - 1]}" ]
    do
       s=${s:0:${s[${#s} - 1]}}
    done
    echo $s
}

